package com.springframework.beans.factory.config;

import com.springframework.beans.factory.MyHierarchicalBeanFactory;
import org.springframework.beans.BeansException;
import org.springframework.beans.TypeConverter;
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
import org.springframework.beans.factory.config.DependencyDescriptor;
import org.springframework.beans.factory.config.Scope;
import org.springframework.core.convert.ConversionService;
import org.springframework.lang.Nullable;

import java.util.Set;

public interface MyConfigurableBeanFactory extends MyHierarchicalBeanFactory, MySingletonBeanRegistry {
    String SCOPE_SINGLETON = "singleton";

    boolean isFactoryBean(String name) throws NoSuchBeanDefinitionException;
    String SCOPE_PROTOTYPE = "prototype";
    MyBeanDefinition getMergedBeanDefinition(String beanName) throws NoSuchBeanDefinitionException;
    boolean isCacheBeanMetadata();
    void setCacheBeanMetadata(boolean cacheBeanMetadata);
    TypeConverter getTypeConverter();
    @Nullable
    ConversionService getConversionService();

    void registerScope(String scopeName, Scope scope);
    String[] getRegisteredScopeNames();
    @Nullable
    Scope getRegisteredScope(String scopeName);
    @Nullable
    ClassLoader getBeanClassLoader();
    @Nullable
    ClassLoader getTempClassLoader();
    @Nullable
    Object resolveDependency(DependencyDescriptor descriptor, @Nullable String requestingBeanName,
                             @Nullable Set<String> autowiredBeanNames, @Nullable TypeConverter typeConverter) throws BeansException;

}
